#include <REGX52.H>
#include "lcd1602.h"
#include "Delay.h"
#include "int0.h"
#include "timer.h"
#include "ir.h"
unsigned char Num;
unsigned int Address;
unsigned int Command;
void main()
{
    LCD_Init();
	IR_Init();
	LCD_ShowString(1,1,"ADDR  CMD  NUM");
	//LCD_ShowString(2,1,"00  00  0000");
	while(1)
	{
		if(IR_GetDataFlag()|| IR_GetRepeaFlag())
		{
		  Address=IR_GetAddress();
		  Command=IR_GetCommand();
		  LCD_ShowHexNum(2,1,Address,2);
		  LCD_ShowHexNum(2,5,Command,2);
			if(Command==IR_6)
			{
				Num--;
			}
			if(Command==IR_5)
			{
				Num++;
			}
			LCD_ShowNum(2,9,Num,3);
		}

	}

}

